/*
 * Copyright 2018 JDCLOUD.COM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http:#www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * 京东云WAF-OpenAPI接口
 * 京东云WAF-OpenAPI接口
 *
 * OpenAPI spec version: v1
 * Contact: 
 *
 * NOTE: This class is auto generated by the jdcloud code generator program.
 */


using JDCloudSDK.Core.Auth;
using JDCloudSDK.Core.Client;
using JDCloudSDK.Core.Http;
using JDCloudSDK.Waf.Apis;
using JDCloudSDK.Waf.Model;
using System;
using System.Collections.Generic;
using System.Text;
#if NET40||NET35
#else
using System.Threading.Tasks;
#endif

namespace JDCloudSDK.Waf.Client
{
    /// <summary>
    ///  京东云WAF-OpenAPI接口
    ///  京东云WAF-OpenAPI接口
    ///  Waf Api 客户端
    ///</summary>
    public class WafClient : JdcloudClient
    {

        /// <summary>
        ///  默认私有构造函数
        /// </summary>
        private WafClient()
        {

        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        /// <param name="credentialsProvider">认证信息</param>
        /// <param name="httpRequestConfig">http 客户端配置信息</param>
        /// <param name="environment">sdk 环境配置信息</param>
        public WafClient(CredentialsProvider credentialsProvider, HttpRequestConfig httpRequestConfig,SDKEnvironment environment)
        {
            this.httpRequestConfig = httpRequestConfig;
            this.credentialsProvider = credentialsProvider;
            this.environment = environment;
        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        /// <param name="httpRequestConfig">http 客户端配置信息</param>
        /// <param name="credentialsProvider">认证信息</param>
        public WafClient(CredentialsProvider credentialsProvider,HttpRequestConfig httpRequestConfig)
        {
            this.httpRequestConfig = httpRequestConfig;
            this.credentialsProvider = credentialsProvider;
        }

        /// <summary>
        /// 默认构造函数，
        /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https
        /// </summary>
        /// <param name="credentialsProvider">认证信息</param>
        public WafClient(CredentialsProvider credentialsProvider)
        {
            this.credentialsProvider = credentialsProvider;
        }

        /// <summary>
        ///  版本号 1.2.8
        ///</summary>
        public const string ClientVersion = "1.2.8";

        private const string apiVersion = "v1";
        private const string userAgentPrefix = "JdcloudSdkDotNet";
        private const string defaultEndpoint = "waf.jdcloud-api.com";
        private const string serviceName = "waf";
        private const string userAgent = userAgentPrefix + "/" + ClientVersion + " " + serviceName + "/" + apiVersion;


        private SDKEnvironment environment = new SDKEnvironment(defaultEndpoint);
        private CredentialsProvider credentialsProvider;
        private HttpRequestConfig httpRequestConfig;

        /// <summary>
        ///  获取证书信息
        ///</summary>
        public override CredentialsProvider CredentialsProvider   { get { return credentialsProvider; } }

        /// <summary>
        ///  获取http 客户端配置信息
        ///</summary>
        public override HttpRequestConfig HttpRequestConfig { get { return httpRequestConfig; } }

        /// <summary>
        ///  获取sdk环境配置信息
        ///</summary>
        public override SDKEnvironment SDKEnvironment { get { return environment; } }

        /// <summary>
        ///  获取用户自定义浏览器识别字符串
        ///</summary>
        public override string UserAgent { get { return userAgent; } }

        /// <summary>
        ///  获取服务名称
        ///</summary>
        public override string ServiceName { get { return serviceName; } }

        /// <summary>
        ///  获取版本号
        ///</summary>
        public override string Version { get { return apiVersion; } }



#if NET40||NET35
        /// <summary>
        ///  获取网站waf自定义防护过滤器
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ListWafFilterResponse ListWafFilter(ListWafFilterRequest request) {
            return  new ListWafFilterExecutor().Client(this).Execute<ListWafFilterResponse, ListWafFilterResult, ListWafFilterRequest>(request);
        }
#else
        /// <summary>
        ///  获取网站waf自定义防护过滤器
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ListWafFilterResponse> ListWafFilter(ListWafFilterRequest request) {
            return await new ListWafFilterExecutor().Client(this).Execute<ListWafFilterResponse, ListWafFilterResult, ListWafFilterRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取网站在一定时间内的qps信息。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public GetQpsDataResponse GetQpsData(GetQpsDataRequest request) {
            return  new GetQpsDataExecutor().Client(this).Execute<GetQpsDataResponse, GetQpsDataResult, GetQpsDataRequest>(request);
        }
#else
        /// <summary>
        ///  获取网站在一定时间内的qps信息。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<GetQpsDataResponse> GetQpsData(GetQpsDataRequest request) {
            return await new GetQpsDataExecutor().Client(this).Execute<GetQpsDataResponse, GetQpsDataResult, GetQpsDataRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取网站在一定时间内的状态码报表信息。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public GetStatusCodeInfoResponse GetStatusCodeInfo(GetStatusCodeInfoRequest request) {
            return  new GetStatusCodeInfoExecutor().Client(this).Execute<GetStatusCodeInfoResponse, GetStatusCodeInfoResult, GetStatusCodeInfoRequest>(request);
        }
#else
        /// <summary>
        ///  获取网站在一定时间内的状态码报表信息。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<GetStatusCodeInfoResponse> GetStatusCodeInfo(GetStatusCodeInfoRequest request) {
            return await new GetStatusCodeInfoExecutor().Client(this).Execute<GetStatusCodeInfoResponse, GetStatusCodeInfoResult, GetStatusCodeInfoRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  新增网站
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AddDomainResponse AddDomain(AddDomainRequest request) {
            return  new AddDomainExecutor().Client(this).Execute<AddDomainResponse, AddDomainResult, AddDomainRequest>(request);
        }
#else
        /// <summary>
        ///  新增网站
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AddDomainResponse> AddDomain(AddDomainRequest request) {
            return await new AddDomainExecutor().Client(this).Execute<AddDomainResponse, AddDomainResult, AddDomainRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取实例ID及相关信息列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public GetWafInstanceResponse GetWafInstance(GetWafInstanceRequest request) {
            return  new GetWafInstanceExecutor().Client(this).Execute<GetWafInstanceResponse, GetWafInstanceResult, GetWafInstanceRequest>(request);
        }
#else
        /// <summary>
        ///  获取实例ID及相关信息列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<GetWafInstanceResponse> GetWafInstance(GetWafInstanceRequest request) {
            return await new GetWafInstanceExecutor().Client(this).Execute<GetWafInstanceResponse, GetWafInstanceResult, GetWafInstanceRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除网站
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteDomainResponse DeleteDomain(DeleteDomainRequest request) {
            return  new DeleteDomainExecutor().Client(this).Execute<DeleteDomainResponse, DeleteDomainResult, DeleteDomainRequest>(request);
        }
#else
        /// <summary>
        ///  删除网站
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteDomainResponse> DeleteDomain(DeleteDomainRequest request) {
            return await new DeleteDomainExecutor().Client(this).Execute<DeleteDomainResponse, DeleteDomainResult, DeleteDomainRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取网站在一定时间内的报表详情。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public GetAntiEventResponse GetAntiEvent(GetAntiEventRequest request) {
            return  new GetAntiEventExecutor().Client(this).Execute<GetAntiEventResponse, GetAntiEventResult, GetAntiEventRequest>(request);
        }
#else
        /// <summary>
        ///  获取网站在一定时间内的报表详情。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<GetAntiEventResponse> GetAntiEvent(GetAntiEventRequest request) {
            return await new GetAntiEventExecutor().Client(this).Execute<GetAntiEventResponse, GetAntiEventResult, GetAntiEventRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  创建waf实例
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CreateInstanceResponse CreateInstance(CreateInstanceRequest request) {
            return  new CreateInstanceExecutor().Client(this).Execute<CreateInstanceResponse, CreateInstanceResult, CreateInstanceRequest>(request);
        }
#else
        /// <summary>
        ///  创建waf实例
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CreateInstanceResponse> CreateInstance(CreateInstanceRequest request) {
            return await new CreateInstanceExecutor().Client(this).Execute<CreateInstanceResponse, CreateInstanceResult, CreateInstanceRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  绑定证书
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public BindCertResponse BindCert(BindCertRequest request) {
            return  new BindCertExecutor().Client(this).Execute<BindCertResponse, BindCertResult, BindCertRequest>(request);
        }
#else
        /// <summary>
        ///  绑定证书
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<BindCertResponse> BindCert(BindCertRequest request) {
            return await new BindCertExecutor().Client(this).Execute<BindCertResponse, BindCertResult, BindCertRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  更新网站
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UpdateDomainResponse UpdateDomain(UpdateDomainRequest request) {
            return  new UpdateDomainExecutor().Client(this).Execute<UpdateDomainResponse, UpdateDomainResult, UpdateDomainRequest>(request);
        }
#else
        /// <summary>
        ///  更新网站
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UpdateDomainResponse> UpdateDomain(UpdateDomainRequest request) {
            return await new UpdateDomainExecutor().Client(this).Execute<UpdateDomainResponse, UpdateDomainResult, UpdateDomainRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取网站
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ListMainCfgResponse ListMainCfg(ListMainCfgRequest request) {
            return  new ListMainCfgExecutor().Client(this).Execute<ListMainCfgResponse, ListMainCfgResult, ListMainCfgRequest>(request);
        }
#else
        /// <summary>
        ///  获取网站
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ListMainCfgResponse> ListMainCfg(ListMainCfgRequest request) {
            return await new ListMainCfgExecutor().Client(this).Execute<ListMainCfgResponse, ListMainCfgResult, ListMainCfgRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  cname解析到回源
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public EnableCname2RsExternalResponse EnableCname2RsExternal(EnableCname2RsExternalRequest request) {
            return  new EnableCname2RsExternalExecutor().Client(this).Execute<EnableCname2RsExternalResponse, EnableCname2RsExternalResult, EnableCname2RsExternalRequest>(request);
        }
#else
        /// <summary>
        ///  cname解析到回源
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<EnableCname2RsExternalResponse> EnableCname2RsExternal(EnableCname2RsExternalRequest request) {
            return await new EnableCname2RsExternalExecutor().Client(this).Execute<EnableCname2RsExternalResponse, EnableCname2RsExternalResult, EnableCname2RsExternalRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取网站列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ListDomainsResponse ListDomains(ListDomainsRequest request) {
            return  new ListDomainsExecutor().Client(this).Execute<ListDomainsResponse, ListDomainsResult, ListDomainsRequest>(request);
        }
#else
        /// <summary>
        ///  获取网站列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ListDomainsResponse> ListDomains(ListDomainsRequest request) {
            return await new ListDomainsExecutor().Client(this).Execute<ListDomainsResponse, ListDomainsResult, ListDomainsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取域名防护配置
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public GetDomainAntiConfigResponse GetDomainAntiConfig(GetDomainAntiConfigRequest request) {
            return  new GetDomainAntiConfigExecutor().Client(this).Execute<GetDomainAntiConfigResponse, GetDomainAntiConfigResult, GetDomainAntiConfigRequest>(request);
        }
#else
        /// <summary>
        ///  获取域名防护配置
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<GetDomainAntiConfigResponse> GetDomainAntiConfig(GetDomainAntiConfigRequest request) {
            return await new GetDomainAntiConfigExecutor().Client(this).Execute<GetDomainAntiConfigResponse, GetDomainAntiConfigResult, GetDomainAntiConfigRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  设置waf策略等级
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AntiLevelWafResponse AntiLevelWaf(AntiLevelWafRequest request) {
            return  new AntiLevelWafExecutor().Client(this).Execute<AntiLevelWafResponse, AntiLevelWafResult, AntiLevelWafRequest>(request);
        }
#else
        /// <summary>
        ///  设置waf策略等级
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AntiLevelWafResponse> AntiLevelWaf(AntiLevelWafRequest request) {
            return await new AntiLevelWafExecutor().Client(this).Execute<AntiLevelWafResponse, AntiLevelWafResult, AntiLevelWafRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  规则开关
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DisableRulesResponse DisableRules(DisableRulesRequest request) {
            return  new DisableRulesExecutor().Client(this).Execute<DisableRulesResponse, DisableRulesResult, DisableRulesRequest>(request);
        }
#else
        /// <summary>
        ///  规则开关
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DisableRulesResponse> DisableRules(DisableRulesRequest request) {
            return await new DisableRulesExecutor().Client(this).Execute<DisableRulesResponse, DisableRulesResult, DisableRulesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取网站lb配置
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public GetDomainLbConfigResponse GetDomainLbConfig(GetDomainLbConfigRequest request) {
            return  new GetDomainLbConfigExecutor().Client(this).Execute<GetDomainLbConfigResponse, GetDomainLbConfigResult, GetDomainLbConfigRequest>(request);
        }
#else
        /// <summary>
        ///  获取网站lb配置
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<GetDomainLbConfigResponse> GetDomainLbConfig(GetDomainLbConfigRequest request) {
            return await new GetDomainLbConfigExecutor().Client(this).Execute<GetDomainLbConfigResponse, GetDomainLbConfigResult, GetDomainLbConfigRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  激活waf自定义规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public EnableWafUserDefineResponse EnableWafUserDefine(EnableWafUserDefineRequest request) {
            return  new EnableWafUserDefineExecutor().Client(this).Execute<EnableWafUserDefineResponse, EnableWafUserDefineResult, EnableWafUserDefineRequest>(request);
        }
#else
        /// <summary>
        ///  激活waf自定义规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<EnableWafUserDefineResponse> EnableWafUserDefine(EnableWafUserDefineRequest request) {
            return await new EnableWafUserDefineExecutor().Client(this).Execute<EnableWafUserDefineResponse, EnableWafUserDefineResult, EnableWafUserDefineRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  设置waf自定义规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public SetWafRuleResponse SetWafRule(SetWafRuleRequest request) {
            return  new SetWafRuleExecutor().Client(this).Execute<SetWafRuleResponse, SetWafRuleResult, SetWafRuleRequest>(request);
        }
#else
        /// <summary>
        ///  设置waf自定义规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<SetWafRuleResponse> SetWafRule(SetWafRuleRequest request) {
            return await new SetWafRuleExecutor().Client(this).Execute<SetWafRuleResponse, SetWafRuleResult, SetWafRuleRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  激活waf
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public EnableWafResponse EnableWaf(EnableWafRequest request) {
            return  new EnableWafExecutor().Client(this).Execute<EnableWafResponse, EnableWafResult, EnableWafRequest>(request);
        }
#else
        /// <summary>
        ///  激活waf
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<EnableWafResponse> EnableWaf(EnableWafRequest request) {
            return await new EnableWafExecutor().Client(this).Execute<EnableWafResponse, EnableWafResult, EnableWafRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取网站在一定时间内的日志详情。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public GetEsLogDetailResponse GetEsLogDetail(GetEsLogDetailRequest request) {
            return  new GetEsLogDetailExecutor().Client(this).Execute<GetEsLogDetailResponse, GetEsLogDetailResult, GetEsLogDetailRequest>(request);
        }
#else
        /// <summary>
        ///  获取网站在一定时间内的日志详情。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<GetEsLogDetailResponse> GetEsLogDetail(GetEsLogDetailRequest request) {
            return await new GetEsLogDetailExecutor().Client(this).Execute<GetEsLogDetailResponse, GetEsLogDetailResult, GetEsLogDetailRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取回源ip段
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeLbOutIpResponse DescribeLbOutIp(DescribeLbOutIpRequest request) {
            return  new DescribeLbOutIpExecutor().Client(this).Execute<DescribeLbOutIpResponse, DescribeLbOutIpResult, DescribeLbOutIpRequest>(request);
        }
#else
        /// <summary>
        ///  获取回源ip段
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeLbOutIpResponse> DescribeLbOutIp(DescribeLbOutIpRequest request) {
            return await new DescribeLbOutIpExecutor().Client(this).Execute<DescribeLbOutIpResponse, DescribeLbOutIpResult, DescribeLbOutIpRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取网站在一定时间内的bps信息。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public GetBpsDataResponse GetBpsData(GetBpsDataRequest request) {
            return  new GetBpsDataExecutor().Client(this).Execute<GetBpsDataResponse, GetBpsDataResult, GetBpsDataRequest>(request);
        }
#else
        /// <summary>
        ///  获取网站在一定时间内的bps信息。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<GetBpsDataResponse> GetBpsData(GetBpsDataRequest request) {
            return await new GetBpsDataExecutor().Client(this).Execute<GetBpsDataResponse, GetBpsDataResult, GetBpsDataRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除waf自定义规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DelWafRuleResponse DelWafRule(DelWafRuleRequest request) {
            return  new DelWafRuleExecutor().Client(this).Execute<DelWafRuleResponse, DelWafRuleResult, DelWafRuleRequest>(request);
        }
#else
        /// <summary>
        ///  删除waf自定义规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DelWafRuleResponse> DelWafRule(DelWafRuleRequest request) {
            return await new DelWafRuleExecutor().Client(this).Execute<DelWafRuleResponse, DelWafRuleResult, DelWafRuleRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取域名可用证书列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public GetAvailableCertForDomainResponse GetAvailableCertForDomain(GetAvailableCertForDomainRequest request) {
            return  new GetAvailableCertForDomainExecutor().Client(this).Execute<GetAvailableCertForDomainResponse, GetAvailableCertForDomainResult, GetAvailableCertForDomainRequest>(request);
        }
#else
        /// <summary>
        ///  获取域名可用证书列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<GetAvailableCertForDomainResponse> GetAvailableCertForDomain(GetAvailableCertForDomainRequest request) {
            return await new GetAvailableCertForDomainExecutor().Client(this).Execute<GetAvailableCertForDomainResponse, GetAvailableCertForDomainResult, GetAvailableCertForDomainRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取网站的waf自定义规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ListWafRulesResponse ListWafRules(ListWafRulesRequest request) {
            return  new ListWafRulesExecutor().Client(this).Execute<ListWafRulesResponse, ListWafRulesResult, ListWafRulesRequest>(request);
        }
#else
        /// <summary>
        ///  获取网站的waf自定义规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ListWafRulesResponse> ListWafRules(ListWafRulesRequest request) {
            return await new ListWafRulesExecutor().Client(this).Execute<ListWafRulesResponse, ListWafRulesResult, ListWafRulesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取网站已知类型bot规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ListBotStdRulesResponse ListBotStdRules(ListBotStdRulesRequest request) {
            return  new ListBotStdRulesExecutor().Client(this).Execute<ListBotStdRulesResponse, ListBotStdRulesResult, ListBotStdRulesRequest>(request);
        }
#else
        /// <summary>
        ///  获取网站已知类型bot规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ListBotStdRulesResponse> ListBotStdRules(ListBotStdRulesRequest request) {
            return await new ListBotStdRulesExecutor().Client(this).Execute<ListBotStdRulesResponse, ListBotStdRulesResult, ListBotStdRulesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  设置waf防护模式
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AntiModeWafResponse AntiModeWaf(AntiModeWafRequest request) {
            return  new AntiModeWafExecutor().Client(this).Execute<AntiModeWafResponse, AntiModeWafResult, AntiModeWafRequest>(request);
        }
#else
        /// <summary>
        ///  设置waf防护模式
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AntiModeWafResponse> AntiModeWaf(AntiModeWafRequest request) {
            return await new AntiModeWafExecutor().Client(this).Execute<AntiModeWafResponse, AntiModeWafResult, AntiModeWafRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  升配订单
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UpgradeInstanceResponse UpgradeInstance(UpgradeInstanceRequest request) {
            return  new UpgradeInstanceExecutor().Client(this).Execute<UpgradeInstanceResponse, UpgradeInstanceResult, UpgradeInstanceRequest>(request);
        }
#else
        /// <summary>
        ///  升配订单
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UpgradeInstanceResponse> UpgradeInstance(UpgradeInstanceRequest request) {
            return await new UpgradeInstanceExecutor().Client(this).Execute<UpgradeInstanceResponse, UpgradeInstanceResult, UpgradeInstanceRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除网站waf自定义防护条件
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DelWafConditionResponse DelWafCondition(DelWafConditionRequest request) {
            return  new DelWafConditionExecutor().Client(this).Execute<DelWafConditionResponse, DelWafConditionResult, DelWafConditionRequest>(request);
        }
#else
        /// <summary>
        ///  删除网站waf自定义防护条件
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DelWafConditionResponse> DelWafCondition(DelWafConditionRequest request) {
            return await new DelWafConditionExecutor().Client(this).Execute<DelWafConditionResponse, DelWafConditionResult, DelWafConditionRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  设置网站waf自定义防护条件
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public SetWafConditionResponse SetWafCondition(SetWafConditionRequest request) {
            return  new SetWafConditionExecutor().Client(this).Execute<SetWafConditionResponse, SetWafConditionResult, SetWafConditionRequest>(request);
        }
#else
        /// <summary>
        ///  设置网站waf自定义防护条件
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<SetWafConditionResponse> SetWafCondition(SetWafConditionRequest request) {
            return await new SetWafConditionExecutor().Client(this).Execute<SetWafConditionResponse, SetWafConditionResult, SetWafConditionRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取网站waf自定义防护条件
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ListWafConditionsResponse ListWafConditions(ListWafConditionsRequest request) {
            return  new ListWafConditionsExecutor().Client(this).Execute<ListWafConditionsResponse, ListWafConditionsResult, ListWafConditionsRequest>(request);
        }
#else
        /// <summary>
        ///  获取网站waf自定义防护条件
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ListWafConditionsResponse> ListWafConditions(ListWafConditionsRequest request) {
            return await new ListWafConditionsExecutor().Client(this).Execute<ListWafConditionsResponse, ListWafConditionsResult, ListWafConditionsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取网站在一定时间内主要的防护信息,新接口，无url响应时间分布。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public GetMainAntiInfoNewResponse GetMainAntiInfoNew(GetMainAntiInfoNewRequest request) {
            return  new GetMainAntiInfoNewExecutor().Client(this).Execute<GetMainAntiInfoNewResponse, GetMainAntiInfoNewResult, GetMainAntiInfoNewRequest>(request);
        }
#else
        /// <summary>
        ///  获取网站在一定时间内主要的防护信息,新接口，无url响应时间分布。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<GetMainAntiInfoNewResponse> GetMainAntiInfoNew(GetMainAntiInfoNewRequest request) {
            return await new GetMainAntiInfoNewExecutor().Client(this).Execute<GetMainAntiInfoNewResponse, GetMainAntiInfoNewResult, GetMainAntiInfoNewRequest>(request).ConfigureAwait(false);
        }
#endif

            /// <summary>
            ///  默认WafClient 构造器 接口
            ///</summary>
            public interface Builder
            {

                /// <summary>
                /// 设置认证信息参数
                /// </summary>
                /// <param name="provider">认证信息提供对象</param>
                /// <returns>wafClient 构造器</returns>
                Builder CredentialsProvider(CredentialsProvider provider);

                /// <summary>
                /// 设置请求环境参数
                /// </summary>
                /// <param name="environment">环境参数信息</param>
                /// <returns>wafClient 构造器</returns>
                Builder Environment(Core.Client.SDKEnvironment environment);

                /// <summary>
                /// http 请求配置信息
                /// </summary>
                /// <param name="config">http 请求配置信息</param>
                /// <returns>wafClient 构造器</returns>
                Builder HttpRequestConfig(HttpRequestConfig config);

                /// <summary>
                ///  构造WafClient 对象
                ///</summary>
                WafClient Build();
            }

            /// <summary>
            ///  默认WafClient 构造器
            ///</summary>
            public class DefaultBuilder : Builder
            {
                /// <summary>
                ///  WafClient service client
                /// </summary>
                private  WafClient wafClient;

                /// <summary>
                ///  默认WafClient 构造器构造对象
                ///</summary>
                public DefaultBuilder()
                {
                    wafClient = new WafClient();
                }

                /// <summary>
                ///  构造WafClient 对象
                ///</summary>
                public WafClient Build()
                {
                    if (wafClient.CredentialsProvider == null)
                    {
                        //if credentialsProvider not set, try load jdcloud global default  credentials provider
                        wafClient.credentialsProvider = JdCloud.DefaultInstance.GetCredentialsProvider();
                        if (wafClient.credentialsProvider == null)
                        {
                            throw new ArgumentNullException("WafClient build error: jdcloud credentials provider not set");
                        }
                    }
                    if (wafClient.HttpRequestConfig == null)
                    {
                        wafClient.httpRequestConfig = JdCloud.DefaultInstance.GetHttpRequestConfig();
                        if (wafClient.httpRequestConfig == null)
                        {
                        throw new ArgumentNullException("WafClient build error: http request config not set");
                        }
                    }
                    return wafClient;
                }

                /// <summary>
                /// 设置认证信息参数
                /// </summary>
                /// <param name="provider">认证信息提供对象</param>
                /// <returns>wafClient 构造器</returns>
                public Builder CredentialsProvider(CredentialsProvider provider)
                {
                    wafClient.credentialsProvider = provider;
                    return this;
                }

                /// <summary>
                /// 设置请求环境参数
                /// </summary>
                /// <param name="environment">环境参数信息</param>
                /// <returns>wafClient 构造器</returns>
                public Builder Environment(SDKEnvironment environment)
                {
                    wafClient.environment = environment;
                    return this;
                }

                /// <summary>
                /// http 请求配置信息
                /// </summary>
                /// <param name="config">http 请求配置信息</param>
                /// <returns>wafClient 构造器</returns>
                public Builder HttpRequestConfig(HttpRequestConfig config)
                {
                    wafClient.httpRequestConfig = config;
                    return this;
                }
            }
    }
}
